]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
Allow other clients to preempt the channels we are handling
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>
Fri, 24 Jun 2011 12:29:23 +0000 (14:29 +0200)
committerGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>
Mon, 11 Jul 2011 12:43:14 +0000 (14:43 +0200)
This is needed if we are handling an incoming text channel and then user tries
to open a chat with the same contact using Empathy. In this case, the Shell
should delegate the channel back to Empathy and just continue observing it as
it does for usual outgoing channels.

Depends on telepathy-glib 0.15.3 as
tp_base_client_set_delegated_channels_callback() has been added in this
version.

https://bugzilla.gnome.org/show_bug.cgi?id=654237

configure.ac
js/ui/telepathyClient.js

index 5ec4021c13748975e89c8f65c2b33d54e5e75806..9e4d03cc19e30c89557a9e691ede2232d925cf5a 100644 (file)
@@ -73,7 +73,7 @@ GIO_MIN_VERSION=2.25.9
 LIBECAL_MIN_VERSION=2.32.0
 LIBEDATASERVER_MIN_VERSION=1.2.0
 LIBEDATASERVERUI_MIN_VERSION=2.91.6
-TELEPATHY_GLIB_MIN_VERSION=0.15.0
+TELEPATHY_GLIB_MIN_VERSION=0.15.3
 TELEPATHY_LOGGER_MIN_VERSION=0.2.4
 POLKIT_MIN_VERSION=0.100
 STARTUP_NOTIFICATION_MIN_VERSION=0.11
index e0bd8d0636ce0e039f70781e715284c2d8434fba..5c51f31216474570d40494ea35f38825bea3c591 100644 (file)
@@ -91,6 +91,11 @@ Client.prototype = {
         this._tpClient.set_handle_channels_func(
             Lang.bind(this, this._handleChannels));
 
+        // Allow other clients (such as Empathy) to pre-empt our channels if
+        // needed
+        this._tpClient.set_delegated_channels_callback(
+            Lang.bind(this, this._delegatedChannelsCb));
+
         try {
             this._tpClient.register();
         } catch (e) {
@@ -245,6 +250,11 @@ Client.prototype = {
                               requests, user_action_time, context) {
         this._handlingChannels(account, conn, channels);
         context.accept();
+    },
+
+    _delegatedChannelsCb: function(client, channels) {
+        // Nothing to do as we don't make a distinction between observed and
+        // handled channels.
     }
 };